@import "compass";

/* Colors */

$get: #e7f0f7;
$post: #e7f6ec;
$put: #f9f2e9;
$delete: #f5e8e8;

/* Mixins */
/*
  Setting colors for a method container, the form, and http method indicator
*/
@mixin method($method: 'get', $color: $get) {
    .#{$method} {
        background: $color;
        border-color: darken($color, 15%);

        & .http-method {
            background-color: saturate(darken($color, 60%), 50%);
        }

        th, td {
            border-bottom: 1px solid darken($color, 20%);
        }
    }
}

/*
  font-family for monospace
*/
@mixin monospace() {
    font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Bitstream Vera Mono', monospace;
}

html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,
q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,
th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
  display: block;
}

blockquote,q {
  quotes: none;
}

blockquote:before,blockquote:after,q:before,q:after {
  content: "";
  content: none;
}

ins {
  background-color: #ff9;
  color: #000;
  text-decoration: none;
}

mark {
  background-color: #ff9;
  color: #000;
  font-style: italic;
  font-weight: bold;
}

del {
  text-decoration: line-through;
}

abbr[title],
dfn[title] {
  border-bottom: 1px dotted;
  cursor: help;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

input,
select {
  vertical-align: middle;
}

body {
  font: 13px / 1.231 sans-serif;
  *font-size: small;
}

select,
input,
textarea,
button {
  font: 99% sans-serif;
}

pre,
code,
kbd,
samp {
  font-family: monospace, sans-serif;
}

html {
  overflow-y: scroll;
}

a:link {
  -webkit-tap-highlight-color: #ff5e99;
}

a:hover,
a:active {
  outline: none;
}

a,
a:active,
a:visited {
  color: #607890;
}

a:hover {
  color: #036;
}

ul,
ol {
  margin-left: 2em;
}

ol {
  list-style-type: decimal;
}

nav ul,
nav li {
  margin: 0;
  list-style: none;
  list-style-image: none;
}

small {
  font-size: 85%;
}

strong,
th {
  font-weight: bold;
}

td {
  vertical-align: top;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 15px;
}

.ie6 legend,
.ie7 legend {
  margin-left: -7px;
}

input[type="radio"] {
  vertical-align: text-bottom;
}

input[type="checkbox"] {
  vertical-align: bottom;
}

.ie7 input[type="checkbox"] {
  vertical-align: baseline;
}

.ie6 input {
  vertical-align: text-bottom;
}

label,
input[type="button"],
input[type="submit"],
input[type="image"],
button {
  cursor: pointer;
}

button,
input,
select,
textarea {
  width: auto;
  overflow: visible;
  margin: 0;
}

textarea {
  overflow: auto;
}

input::-moz-focus-inner,
button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

input:invalid,
textarea:invalid {
    @include border-radius(1px);
    @include box-shadow(0,0,5px, #f00);
}

.no-boxshadow input:invalid,
.no-boxshadow textarea:invalid {
  background-color: #f0dddd;
}

::-moz-selection {
  background: #ff5e99;
  color: #fff;
  text-shadow: none;
}

::selection {
  background: #ff5e99;
  color: #fff;
  text-shadow: none;
}

.ie7 img {
  -ms-interpolation-mode: bicubic;
}


body,
select,
input,
textarea {
  color: #444;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1,h2,h3,h4,h5,h6 {
  font-weight: bold;
}

html {
  height: 100%;
}

body {
  width: 960px;
  margin: 15px auto;
}

h1 {
  font-size: 24px;
  line-height: 1.5;
  margin-bottom: 15px;
}

h2 {
    font-weight: normal;
    font-size: 18px;
    margin-bottom: 15px;
}

ul {
    margin: 0;
}

li {
    list-style: none;
    margin-left: 0;
}

.credentials {
    background-color: #f4f4e1;
    border: 1px solid darken(#f4f4e1, 30%);
    @include border-radius(5px);
    @include clearfix;
    padding: 15px;

    h2 img {
        margin-left: 10px;
    }

    div {
        float: left;
        margin-right: 15px;
    }

    label {
        font-weight: bold;
        display: block;
        margin-bottom: 3px;
    }

    input {
        width: 200px;
    }
}

#controls {
    @include clearfix;
    margin-top: 10px;
    border: 1px solid #999;
    border-width: 1px 0;
    padding: 10px 0;

    li {
        padding-right: 10px;
        float: left;

        &:not(:first-child) {
            padding-left: 10px;
            border-left: 1px solid #ddd;
        }
    }
}

.endpoint {
    margin: 0;
    border-bottom: 1px solid #eee;
    @include clearfix;

    & > .title {
        padding: 20px 0 10px;
        @include clearfix;

        & .name {
            font-size: 18px;
            float: left;

            &:hover {
                cursor: pointer;
                text-decoration: underline;
            }
        }

        & .actions {
            float: right;

            li {
                float: left;
                padding: 0 10px;
                border-left: 1px solid #ddd;
            }

            li:first-child {
                border: 0;
            }
        }
    }
}

.methods {
    display: none;
}

.method {
    font-size: 14px;
    border: 1px solid #eee;
    @include border-radius(5px);
    margin: 10px 0;

    .title {
        overflow: hidden;
        @include border-radius(5px);

        &:hover {
            background-color: rgba(255,255,255, 0.5);
            cursor: pointer;

            span {
                text-decoration: underline;

                &.http-method {
                    text-decoration: none;
                }
            }

        }

        span {
            margin: 0 10px 0;
            line-height: 33px;
            float: left;
        }

        .name {
            font-size: 16px;
        }

        .description {
            float: right;
            font-size: 12px;
            text-align: right;
        }

        .http-method {
            padding: 0 10px;
            width: 40px;
            font-size: 12px;
            text-align: center;
            margin: 0;
            @include monospace;
            @include border-radius(5px);
            color: #fff;
            line-height: 33px;
            float: left;
        }

    }

    // Instead of this indicator, maybe do a validation check on attempt and tell them to set their key/secret.
/*    &.authrequired .http-method {
        background-image: url(/images/lock.png);
        background-repeat: no-repeat;
        background-position: 7px 50%;
    }*/

    form {
        clear: both;
        padding: 15px;
        display: none;
    }

    table {
        margin-bottom: 15px;
        width: 100%;
    }

    tr.required {
        font-weight: bold;
    }

    th {
        font-weight: bold;
        text-align: left;
    }

    th, td {
        padding: 5px;
        vertical-align: middle;
    }

    td, pre {
        @include monospace;
    }

    h2 {
        margin-top: 15px;
        margin-bottom: 3px;
    }

    pre {
        font-size: 12px;
        overflow: auto;
        border: 1px solid rgba(0,0,0,0.2);
        background-color: rgba(255,255,255,0.4);

        &.response {
            max-height: 500px;
        }

        &.error {
            background-color: rgba(255,66,66,0.2);
        }
    }
}

@include method();
@include method('post', $post);
@include method('put', $put);
@include method('delete', $delete);


.ir {
  display: block;
  text-indent: -999em;
  overflow: hidden;
  background-repeat: no-repeat;
  text-align: left;
  direction: ltr;
}

.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

.invisible {
  visibility: hidden;
}

.clearfix:before,
.clearfix:after {
  content: "\0020";
  display: block;
  height: 0;
  overflow: hidden;
}

.clearfix:after {
  clear: both;
}

.clearfix {
  zoom: 1;
}

@media all and (orientation:portrait) {
}

@media all and (orientation:landscape) {
}

@media screen and (max-device-width: 480px) {
}

@media print {
      * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
      -ms-filter: none !important; }
 /* Black prints faster: sanbeiji.com/archives/953 */
      a, a:visited { color: #444 !important; text-decoration: underline; }

      a[href]:after { content: " (" attr(href) ")"; }

      abbr[title]:after { content: " (" attr(title) ")"; }

      .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
  /* Don't show links for images, or javascript/internal links */
      pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }

      thead { display: table-header-group; }
 /* css-discuss.incutio.com/wiki/Printing_Tables */
      tr, img { page-break-inside: avoid; }

      @page { margin: 0.5cm; }

      p, h2, h3 { orphans: 3; widows: 3; }

      h2, h3{ page-break-after: avoid; }

  }

